# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import api, fields, models, _

# from .ocr_glority import access_token_check
# import datetime

import logging

_logger = logging.getLogger(__name__)


class CompanyConfig(models.Model):
    _name = "fp.company.glority"
    _inherit = ['fp.company.config.mixin']
    _description = "Fapiao Company glority"
    _order = 'name'

    # access_token = fields.Char(string='Access Token')
    # expires_in = fields.Integer(string='Expires_in')
    # lasttime = fields.Datetime(string='Lasttime')

    # def access_token_check(self):
    #     res = access_token_check(self)
    #     _logger.info("Nuonuo Token is checked: %s" % res)

    #     if res:
    #         now = datetime.datetime.now()
    #         self.write({
    #             'access_token': res['access_token'],
    #             'expires_in': res['expires_in'],
    #             'lasttime': now.strftime('%Y-%m-%d %H:%M:%S'),
    #         })

    #     return res
